read Or Create And Validate
overload of readOrCreateAndValidate that automatically applies the name, folder, and subfolder from the config itself. Automatically adds ".toml" to the name for reading and writing.
Return
An instance of the configClass passed to it, updated and validated or passed back as-is, depending on circumstances and errors encountered
Author
fzzyhmstrs
Since
0.2.0
Parameters
type of config being created. Any subclass of Config
Function0 of T
overload of readOrCreateAndValidate that automatically applies the name, folder, and subfolder from the config itself. Automatically adds ".toml" to the name for reading and writing.
Return
An instance of the configClass passed to it, updated and validated or passed back as-is, depending on circumstances and errors encountered
Author
fzzyhmstrs
Since
0.3.2
Parameters
type of config being created. Any subclass of Config
Supplier of T
Deprecated
Consider registerAndLoadConfig() instead, or readOrCreateAndValidate(configClass) for consistent application of names
Reads a config from File or Creates a new config class; writes out any corrections, updates, or new content to File. Automatically adds ".toml" to the name for reading and writing.
Includes Version updating support, automatic validation and correction, and detailed error reporting. Use this to generate the actual config class instance to be used in-game, if you have other custom initialization to perform, otherwise see registerAndLoadConfig. See the Example Config for typical usage case.
Return
An instance of the configClass passed to it, updated and validated or passed back as-is, depending on circumstances and errors encountered
Author
fzzyhmstrs
Since
0.2.0
Parameters
The config class type. Must be a subclass of Config
String. The config name, will become the file name. In an identifier, would be the "path". Adds ".toml" to the name for reading/writing to file automatically.
String, optional. A base config folder name. If left out, will write to the main config directory (not recommended). In an Identifier, this would be the "namespace"
String, optional. A subfolder name if desired. By default, blank. The file will appear in the base "namespace" folder if no child is given.
Function0. A provider of instances of the config class itself. In Kotlin this can typically be written like { MyConfigClass() }
Deprecated
Consider registerAndLoadConfig() instead, or readOrCreateAndValidate(configClass) for consistent application of names
Reads a config from File or Creates a new config class; writes out any corrections, updates, or new content to File. Automatically adds ".toml" to the name for reading and writing.
Includes Version updating support, automatic validation and correction, and detailed error reporting. Use this to generate the actual config class instance to be used in-game, if you have other custom initialization to perform, otherwise see registerAndLoadConfig. See the Example Config for typical usage case.
Return
An instance of the configClass passed to it, updated and validated or passed back as-is, depending on circumstances and errors encountered
Author
fzzyhmstrs
Since
0.3.2
Parameters
The config class type. Must be a subclass of Config
String. The config name, will become the file name. In an identifier, would be the "path". Adds ".toml" to the name for reading/writing to file automatically.
String, optional. A base config folder name. If left out, will write to the main config directory (not recommended). In an Identifier, this would be the "namespace"
String, optional. A subfolder name if desired. By default, blank. The file will appear in the base "namespace" folder if no child is given.
Supplier. A provider of instances of the config class itself.